package com.qfedu.aunt.commons.utils;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author xiaobobo
 * @title: ThreadPoolUtils
 * @projectName aunt_commons_2209
 * @description: TODO
 * @date 2022/10/24  16:01
 */
public class ThreadPoolUtils {

    private static ThreadPoolExecutor  threadPoolExecutor=new ThreadPoolExecutor(
            100,1000,3, TimeUnit.SECONDS,new ArrayBlockingQueue<>(8192)
    );

    //用户行为记录的这个线程(因为多次的IO操作MySQL效率并不高 所以需要线程池的加持)
    private static ThreadPoolExecutor  behaviorLogPoolExecutor=new ThreadPoolExecutor(
            100,1000,3, TimeUnit.SECONDS,new ArrayBlockingQueue<>(8192)
    );


    public static ThreadPoolExecutor getBehaviorLogPoolExecutor() {
        return behaviorLogPoolExecutor;
    }

    public static ThreadPoolExecutor getThreadPoolExecutor() {
        return threadPoolExecutor;
    }
}
